<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 1000px;
            height: 20px;
            border: 2px solid #000000;
            border-radius: 5px;
        }
        #middle{
            border: none;
            height: 100%;
            width:0;
            background: #653298;
            border-radius: 0;
            position: relative;
        }
        i{
            height: 100%;
            width: 100px; 
            font-size: 20px;
            line-height: 20px;
            position: absolute;
            right: -100px;
            top: 0;
        }
    </style>
</head>
<body>
    <div id="outter">
        <div id="middle">
            <i id="inner">0%</i>
        </div>       
    </div>
    <script>
        function jindutiao(a){
            var step=a;
            var show=setInterval(function(){
            
            step+=100;
            if(step>=1000){
                step=1000;
                clearInterval(show)
            }
            middle.style.width=step+'px'
            
           inner.innerHTML=parseInt(inner.innerHTML)+10+'%'
           console.log(style);
        },500)  
        }
       
        jindutiao(0)
    </script>
</body>
</html>